package com.aaa.dao;

import com.aaa.entity.F_Menu;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

public interface F_MenuDao {
    /**
     * 查询菜单
     * 权限？
     * @return
     */
    @Select("select * from menu")
    List<F_Menu> selectList();
@Insert("insert into menu(name,pid) values(#{name},0)")
    int add(Map map);
@Insert("insert into menu(name,pid) values(#{name},#{pid})")
    int InsertErji(Map map);
@Update("update menu set name=#{name}where id=#{id}")
    int updateErji(Map map);
@Delete("delete from menu where id=#{id}")
    int del(Integer id);
@Select("select roleid , state from emp where username=#{username}")
    int getRoleid(String username);
    @Select("select state from emp where username=#{username}")
    String getstate(String username);
    @Select("select * from menu a LEFT JOIN role_menu b on a.id=b.mid where rid=#{roleid}")
    List<F_Menu> selectListid(int roleid);
}
